<div class="services index">
	<h2><?php __('Service History');?></h2>
	<?php 
	if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0)
	echo $this->Html->link(__('Add New', true), array('controller' => 'Services','action' => 'add')); ?>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th>SL<?php //echo $this->Paginator->sort('id');?></th>
			<th>Date of Entry<?php //echo $this->Paginator->sort('Date of Entry');?></th>
			<th>Entry post<?php //echo $this->Paginator->sort('Entry post');?></th>
			<th>Date of Gazatted<?php //echo $this->Paginator->sort('Date of Gazatted');?></th>
			<th>class<?php //echo $this->Paginator->sort('class');?></th>
			<th>Date of Encadrement<?php //echo $this->Paginator->sort('Date of Encadrement');?></th>
			<th>Name Cadre<?php //echo $this->Paginator->sort('Name Cadre');?></th>
			<?php
		if($session->read('Auth.User.role')!=1){
		?>
			<th class="actions"><?php __('Actions');?></th>
			
			<?php }?>
	</tr>
	<?php
	$i = 0;
	foreach ($services as $service):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i;//echo $service['Service']['id']; ?>&nbsp;</td>
		<td><?php echo $service['Service']['dateofentry']; ?>&nbsp;</td>
		<td><?php echo $service['Service']['entrypost']; ?>&nbsp;</td>
		<td><?php echo $service['Service']['dategazatted']; ?>&nbsp;</td>
		<td><?php echo $service['Service']['class']; ?>&nbsp;</td>
		<td><?php echo $service['Service']['dateofencadrement']; ?>&nbsp;</td>
		<td><?php echo $service['Service']['namecadre']; ?>&nbsp;</td>
		<?php
		if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0){
		?>
		<td class="actions">
			<?php //echo $this->Html->link(__('View', true), array('action' => 'view', $service['Service']['id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('controller' => 'Services','action' => 'edit', $service['Service']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('controller' => 'Services','action' => 'delete', $service['Service']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $service['Service']['id'])); ?>
		</td>
		<?php
		}
		?>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	/*echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));*/
	?>	</p>

	<!-- <div class="paging">
		<?php //echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php //echo $this->Paginator->numbers();?>
 |
		<?php //echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div> -->
</div>
<div class="actions">
	<?php echo $this->element('leftmenu'); ?>
</div>

<?php
/////promotion
?> 
<div class="promotions index">
	<h2><?php __('Promotions');?></h2>
	<?php 
	if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0)
	echo $this->Html->link(__('Add New', true), array('controller' => 'promotions','action' => 'add')); ?>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th>SL<?php //echo $this->Paginator->sort('id');?></th>
			<th>Date of Promotion<?php //echo $this->Paginator->sort('Date of Promotion');?></th>
			<th>Rank/Post<?php //echo $this->Paginator->sort('Rank/Post');?></th>
			<th>Pay scale to which Promoted<?php //echo $this->Paginator->sort('Pay scale to which Promoted');?></th>
			<th>previous pay scale to which promoted<?php //echo $this->Paginator->sort('previous pay scale to which promoted');?></th>
			<th>Nature of promotion<?php //echo $this->Paginator->sort('Nature of promotion');?></th>
			<!-- <th><?php //echo $this->Paginator->sort('user_id');?></th>
			<th><?php //echo $this->Paginator->sort('created');?></th>
			<th><?php //echo $this->Paginator->sort('modified');?></th> -->
			
			<?php
		if($session->read('Auth.User.role')!=1){
		?>
			<th class="actions"><?php __('Actions');?></th>
			<?php }?>
	</tr>
	<?php
	$i = 0;
	foreach ($promotions as $promotion):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php $i; ?>&nbsp;</td>
		<td><?php echo date('d-M-Y', strtotime($promotion['Promotion']['dateofpromotion'])); ?>&nbsp;</td>
		<td><?php echo $promotion['Promotion']['rankpost']; ?>&nbsp;</td>
		<td><?php echo $promotion['Promotion']['payscale']; ?>&nbsp;</td>
		<td><?php echo $promotion['Promotion']['prepayscale']; ?>&nbsp;</td>
		<td><?php echo $promotion['Promotion']['naturepromotion']; ?>&nbsp;</td>
		<!-- <td>
			<?php //echo $this->Html->link($promotion['User']['id'], array('controller' => 'users', 'action' => 'view', $promotion['User']['id'])); ?>
		</td>
		<td><?php //echo $promotion['Promotion']['created']; ?>&nbsp;</td>
		<td><?php //echo $promotion['Promotion']['modified']; ?>&nbsp;</td> -->
		<?php
		if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0){
		?>
		<td class="actions">
			<?php //echo $this->Html->link(__('View', true), array('action' => 'view', $promotion['Promotion']['id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('controller' => 'promotions','action' => 'edit', $promotion['Promotion']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('controller' => 'promotions','action' => 'delete', $promotion['Promotion']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $promotion['Promotion']['id'])); ?>
		</td>
		<?php
		}
		?>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	/*echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));*/
	?>	</p>

	<!-- <div class="paging">
		<?php //echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php //echo $this->Paginator->numbers();?>
 |
		<?php //echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div> -->
</div>
<?php
////////training
?>
<div class="tinformations index">
	<h2><?php __('Training Informations');?></h2>
	<?php 
if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0)
	echo $this->Html->link(__('Add New', true), array('controller' => 'Tinformations','action' => 'add')); ?>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th>SL<?php //echo $this->Paginator->sort('id');?></th>
			<th>Course title<?php //echo $this->Paginator->sort('Course title');?></th>
			<th>Institute<?php //echo $this->Paginator->sort('institute');?></th>
			<th>Date from<?php //echo $this->Paginator->sort('date from');?></th>
			<th>Date to<?php //echo $this->Paginator->sort('date to');?></th>
			<th>Grade<?php //echo $this->Paginator->sort('grade');?></th>
			<th>position<?php //echo $this->Paginator->sort('position');?></th>
			<th>country<?php //echo $this->Paginator->sort('country');?></th>
			<th>place<?php //echo $this->Paginator->sort('place');?></th>
			<?php
		if($session->read('Auth.User.role')!=1){
		?>
			<th class="actions"><?php __('Actions');?></th>
			<?php }?>
	</tr>
	<tr><td colspan="10" align="left">Foreign Training:</td></tr>
        <?php
	$i = 0;
        $c=1;

	foreach ($tinformations as $tinformation):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
                if(($tinformation['Tinformation']['flag']==1 AND $c==1))
                {?>
        <tr><td colspan="10" align="left">Local Training:</td></tr>
        <?php
        $c++;

                }
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; //echo $child['Child']['id']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['coursetitle']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['institute']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['datefrom']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['dateto']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['grade']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['position']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['country']; ?>&nbsp;</td>
		<td><?php echo $tinformation['Tinformation']['place']; ?>&nbsp;</td>
		
		<?php
		if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0){
		?>
		<td class="actions">
			<?php //echo $this->Html->link(__('View', true), array('action' => 'view', $tinformation['Tinformation']['id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('controller' => 'Tinformations','action' => 'edit', $tinformation['Tinformation']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('controller' => 'Tinformations','action' => 'delete', $tinformation['Tinformation']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $tinformation['Tinformation']['id'])); ?>
		</td>
		<?php }?>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	/*echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));*/
	?>	</p>

	<!-- <div class="paging">
		<?php //echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php //echo $this->Paginator->numbers();?>
 |
		<?php //echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div> -->
</div>


<div class="precords index">
	<h2><?php __('Posting Records(Starting from current post)');?></h2>
	<?php 
	if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0)
	echo $this->Html->link(__('Add New', true), array('controller' => 'Precords','action' => 'add')); ?>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th>SL<?php //echo $this->Paginator->sort('id');?></th>
			<th>Post<?php //echo $this->Paginator->sort('post');?></th>
			<th>organization<?php //echo $this->Paginator->sort('organization');?></th>
			<th>Place of Posting<?php //echo $this->Paginator->sort('Place of Posting');?></th>
			<th>Date From<?php //echo $this->Paginator->sort('Date From');?></th>
			<th>Date To<?php //echo $this->Paginator->sort('Date To');?></th>
			<th>Pay Scale<?php //echo $this->Paginator->sort('Pay Scale');?></th>
			<th>Pay(last drawn)<?php //echo $this->Paginator->sort('Pay(last drawn)');?></th>
			<!-- <th><?php //echo $this->Paginator->sort('user_id');?></th>
			<th><?php //echo $this->Paginator->sort('created');?></th>
			<th><?php //echo $this->Paginator->sort('modified');?></th> -->
			<?php
		if($session->read('Auth.User.role')!=1){
		?>
			<th class="actions"><?php __('Actions');?></th>
			<?php }?>
	</tr>
	<?php
	$i = 0;
	foreach ($precords as $precord):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $precord['Precord']['post']; ?>&nbsp;</td>
		<td><?php echo $precord['Precord']['organization']; ?>&nbsp;</td>
		<td><?php echo $precord['Precord']['placeofposting']; ?>&nbsp;</td>
		<td><?php echo date('d-M-Y', strtotime($precord['Precord']['datefrom'])); ?>&nbsp;</td>
		<td><?php 
                if($precord['Precord']['dateto']!=null){
                echo date('d-M-Y', strtotime($precord['Precord']['dateto']));
                }else{
                    echo '-- --';
                }
                ?>&nbsp;</td>
		<td><?php echo $precord['Precord']['payscale']; ?>&nbsp;</td>
		<td><?php echo $precord['Precord']['paylastdrawn']; ?>&nbsp;</td>
		<!-- <td>
			<?php //echo $this->Html->link($precord['User']['id'], array('controller' => 'users', 'action' => 'view', $precord['User']['id'])); ?>
		</td>
		<td><?php //echo $precord['Precord']['created']; ?>&nbsp;</td>
		<td><?php //echo $precord['Precord']['modified']; ?>&nbsp;</td> -->
		<?php
		if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0){
		?>
		
		<td class="actions">
			<?php //echo $this->Html->link(__('View', true), array('action' => 'view', $precord['Precord']['id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('controller' => 'Precords','action' => 'edit', $precord['Precord']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('controller' => 'Precords','action' => 'delete', $precord['Precord']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $precord['Precord']['id'])); ?>
		</td>
		<?php }?>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	/*echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));*/
	?>	</p>

	<!-- <div class="paging">
		<?php //echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php //echo $this->Paginator->numbers();?>
 |
		<?php //echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div> -->
</div>

<div class="travels index">
	<h2><?php __('Travels');?></h2>
	<?php 
	if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0)
	echo $this->Html->link(__('Add New', true), array('controller' => 'Travels','action' => 'add')); ?>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php //echo $this->Paginator->sort('id');?></th>
			<th>Country<?php //echo $this->Paginator->sort('country');?></th>
			<th>Purpose Visit<?php //echo $this->Paginator->sort('Purpose Visit');?></th>
			<th>Date from<?php //echo $this->Paginator->sort('date from');?></th>
			<th>Date to<?php //echo $this->Paginator->sort('date to');?></th>
			<?php
		if($session->read('Auth.User.role')!=1){
		?>
			<th class="actions"><?php __('Actions');?></th>
			<?php }?>
	</tr>
	<?php
	$i = 0;
	foreach ($travels as $travel):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i;//echo $travel['Travel']['id']; ?>&nbsp;</td>
		<td><?php echo $travel['Travel']['country']; ?>&nbsp;</td>
		<td><?php echo $travel['Travel']['purposevisit']; ?>&nbsp;</td>
		<td><?php echo $travel['Travel']['datefrom']; ?>&nbsp;</td>
		<td><?php echo $travel['Travel']['dateto']; ?>&nbsp;</td>
		<?php
		if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0){
		?>
		<td class="actions">
			<?php //echo $this->Html->link(__('View', true), array('action' => 'view', $travel['Travel']['id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('controller' => 'Travels','action' => 'edit', $travel['Travel']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('controller' => 'Travels','action' => 'delete', $travel['Travel']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $travel['Travel']['id'])); ?>
		</td>
		<?php }?>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	/*echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));*/
	?>	</p>

	<!-- <div class="paging">
		<?php //echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php //echo $this->Paginator->numbers();?>
 |
		<?php //echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div> -->
</div>

<div class="recreations index">
	<h2><?php __('Recreations');?></h2>
	<?php 
	if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0)
	echo $this->Html->link(__('Add New', true), array('controller' => 'Recreations','action' => 'add')); ?>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th>SL<?php //echo $this->Paginator->sort('id');?></th>
			<th>Last Drawn<?php //echo $this->Paginator->sort('lastdrawn');?></th>
			<th>Date From<?php //echo $this->Paginator->sort('datefrom');?></th>
			<th>Date To<?php //echo $this->Paginator->sort('dateto');?></th>
			<!-- <th><?php //echo $this->Paginator->sort('user_id');?></th>
			<th><?php //echo $this->Paginator->sort('created');?></th>
			<th><?php //echo $this->Paginator->sort('modified');?></th> -->
			<?php
		if($session->read('Auth.User.role')!=1){
		?>
			<th class="actions"><?php __('Actions');?></th>
			<?php }?>
	</tr>
	<?php
	$i = 0;
	foreach ($recreations as $recreation):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i;//echo $recreation['Recreation']['id']; ?>&nbsp;</td>
		<td><?php echo $recreation['Recreation']['lastdrawn']; ?>&nbsp;</td>
		<td><?php echo date('d-M-Y', strtotime($recreation['Recreation']['datefrom'])); ?>&nbsp;</td>
		<td><?php echo date('d-M-Y', strtotime($recreation['Recreation']['dateto'])); ?>&nbsp;</td>
		<?php
		if($session->read('Auth.User.role')!=1 && $session->read('Auth.User.accept')==0){
		?>
		<td class="actions">
			<?php //echo $this->Html->link(__('View', true), array('action' => 'view', $recreation['Recreation']['id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('controller' => 'Recreations','action' => 'edit', $recreation['Recreation']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('controller' => 'Recreations','action' => 'delete', $recreation['Recreation']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $recreation['Recreation']['id'])); ?>
		</td>
		<?php }?>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	/*echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));*/
	?>	</p>

	<!-- <div class="paging">
		<?php //echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php //echo $this->Paginator->numbers();?>
 |
		<?php //echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div> -->
</div>
